import time

from tools.base_page import BasePage


class QueueDatareport(BasePage):

    def page_verify_canel(self):
        '''
        多中心队列数据报告列表中 生成中状态
        :return:
        '''
        status_locator = self.only_read_yaml('../data/queue_data_report.yaml','report_status_create')
        time.sleep(5)
        try:
            status_text = self.find(status_locator).text
        except:
            time.sleep(5)
            status_text = self.find(status_locator).text

        return status_text

    def page_verify_confirm(self):
        '''
        多中心队列数据报告列表中 未审核状态
        :return:
        '''
        status_locator = self.only_read_yaml('../data/queue_data_report.yaml','report_status_weishenhe')
        try:
            status_text = self.find(status_locator).text
        except:
            time.sleep(5)
            status_text = self.find(status_locator).text
        return status_text


    def verify_skip_page(self):
        '''
        获取当前url 判断url
        :return:
        '''
        time.sleep(3)
        current_url = self.driver.current_url
        try:
            if current_url != 'http://172.16.10.21/mrpv2/#/dataReportList':
                return True
        except:
            return False